package com.chapter13.MyIterator.demo2;

import java.util.ArrayList;
import java.util.List;

public class ForEachMethod {
    public static void main(String[] args) {
        List list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(i);
        }
        //lambda表达式传参
        list.forEach(list1-> System.out.printf("%d",list1));
        System.out.println();

        MyIntergerList myIntergerList = new MyIntergerList();
        myIntergerList.forEach(System.out::println);
    }
}
